
public class Main {
    public static void main(String[] args) {

        //饿汉单例
        System.out.println("饿汉单例");
        System.out.println(EagerSingletonFactory.getInstance().shoInfo());
        System.out.println(EagerSingletonFactory.getInstance().shoInfo());
        EagerSingletonFactory.getInstance().setMyName("Nefelibata");

        //懒汉单例
        System.out.println("懒汉单例");
        System.out.println(LazySingletonFactory.getInstance().shoInfo());
        System.out.println(LazySingletonFactory.getInstance().shoInfo());


    }
}